/*
 * XML Type:  XApplication
 * Namespace: http://www.seedwill.com/xul/applicatoin/
 * Java type: com.seedwill.xul.applicatoin.XApplication
 *
 * Automatically generated - do not modify.
 */
package com.seedwill.xul.applicatoin.impl;
/**
 * An XML XApplication(@http://www.seedwill.com/xul/applicatoin/).
 *
 * This is a complex type.
 */
public class XApplicationImpl extends com.seedwill.xul.core.impl.XIdentifiedImpl implements com.seedwill.xul.applicatoin.XApplication
{
    private static final long serialVersionUID = 1L;
    
    public XApplicationImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName TITLE$0 = 
        new javax.xml.namespace.QName("", "title");
    private static final javax.xml.namespace.QName TYPE$2 = 
        new javax.xml.namespace.QName("", "type");
    private static final javax.xml.namespace.QName MODE$4 = 
        new javax.xml.namespace.QName("", "mode");
    private static final javax.xml.namespace.QName DEFAULTACTION$6 = 
        new javax.xml.namespace.QName("", "defaultAction");
    private static final javax.xml.namespace.QName MANUMANAGER$8 = 
        new javax.xml.namespace.QName("", "manuManager");
    private static final javax.xml.namespace.QName USER$10 = 
        new javax.xml.namespace.QName("", "user");
    private static final javax.xml.namespace.QName SESSION$12 = 
        new javax.xml.namespace.QName("", "session");
    private static final javax.xml.namespace.QName DBSOURCE$14 = 
        new javax.xml.namespace.QName("", "dbSource");
    private static final javax.xml.namespace.QName DBSCHEMASOURCE$16 = 
        new javax.xml.namespace.QName("", "dbSchemaSource");
    
    
    /**
     * Gets the "title" element
     */
    public java.lang.String getTitle()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TITLE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "title" element
     */
    public org.apache.xmlbeans.XmlString xgetTitle()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TITLE$0, 0);
            return target;
        }
    }
    
    /**
     * True if has "title" element
     */
    public boolean isSetTitle()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TITLE$0) != 0;
        }
    }
    
    /**
     * Sets the "title" element
     */
    public void setTitle(java.lang.String title)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TITLE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TITLE$0);
            }
            target.setStringValue(title);
        }
    }
    
    /**
     * Sets (as xml) the "title" element
     */
    public void xsetTitle(org.apache.xmlbeans.XmlString title)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TITLE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TITLE$0);
            }
            target.set(title);
        }
    }
    
    /**
     * Unsets the "title" element
     */
    public void unsetTitle()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TITLE$0, 0);
        }
    }
    
    /**
     * Gets the "type" element
     */
    public java.lang.String getType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "type" element
     */
    public org.apache.xmlbeans.XmlString xgetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$2, 0);
            return target;
        }
    }
    
    /**
     * True if has "type" element
     */
    public boolean isSetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(TYPE$2) != 0;
        }
    }
    
    /**
     * Sets the "type" element
     */
    public void setType(java.lang.String type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(TYPE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(TYPE$2);
            }
            target.setStringValue(type);
        }
    }
    
    /**
     * Sets (as xml) the "type" element
     */
    public void xsetType(org.apache.xmlbeans.XmlString type)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(TYPE$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(TYPE$2);
            }
            target.set(type);
        }
    }
    
    /**
     * Unsets the "type" element
     */
    public void unsetType()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(TYPE$2, 0);
        }
    }
    
    /**
     * Gets the "mode" element
     */
    public com.seedwill.xul.core.XApplicationMode.Enum getMode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MODE$4, 0);
            if (target == null)
            {
                return null;
            }
            return (com.seedwill.xul.core.XApplicationMode.Enum)target.getEnumValue();
        }
    }
    
    /**
     * Gets (as xml) the "mode" element
     */
    public com.seedwill.xul.core.XApplicationMode xgetMode()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XApplicationMode target = null;
            target = (com.seedwill.xul.core.XApplicationMode)get_store().find_element_user(MODE$4, 0);
            return target;
        }
    }
    
    /**
     * Sets the "mode" element
     */
    public void setMode(com.seedwill.xul.core.XApplicationMode.Enum mode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(MODE$4, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(MODE$4);
            }
            target.setEnumValue(mode);
        }
    }
    
    /**
     * Sets (as xml) the "mode" element
     */
    public void xsetMode(com.seedwill.xul.core.XApplicationMode mode)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XApplicationMode target = null;
            target = (com.seedwill.xul.core.XApplicationMode)get_store().find_element_user(MODE$4, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.core.XApplicationMode)get_store().add_element_user(MODE$4);
            }
            target.set(mode);
        }
    }
    
    /**
     * Gets the "defaultAction" element
     */
    public com.seedwill.xul.widget.XAction getDefaultAction()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XAction target = null;
            target = (com.seedwill.xul.widget.XAction)get_store().find_element_user(DEFAULTACTION$6, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "defaultAction" element
     */
    public boolean isSetDefaultAction()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DEFAULTACTION$6) != 0;
        }
    }
    
    /**
     * Sets the "defaultAction" element
     */
    public void setDefaultAction(com.seedwill.xul.widget.XAction defaultAction)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XAction target = null;
            target = (com.seedwill.xul.widget.XAction)get_store().find_element_user(DEFAULTACTION$6, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XAction)get_store().add_element_user(DEFAULTACTION$6);
            }
            target.set(defaultAction);
        }
    }
    
    /**
     * Appends and returns a new empty "defaultAction" element
     */
    public com.seedwill.xul.widget.XAction addNewDefaultAction()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XAction target = null;
            target = (com.seedwill.xul.widget.XAction)get_store().add_element_user(DEFAULTACTION$6);
            return target;
        }
    }
    
    /**
     * Unsets the "defaultAction" element
     */
    public void unsetDefaultAction()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DEFAULTACTION$6, 0);
        }
    }
    
    /**
     * Gets the "manuManager" element
     */
    public com.seedwill.xul.widget.XMenuManager getManuManager()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XMenuManager target = null;
            target = (com.seedwill.xul.widget.XMenuManager)get_store().find_element_user(MANUMANAGER$8, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "manuManager" element
     */
    public boolean isSetManuManager()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(MANUMANAGER$8) != 0;
        }
    }
    
    /**
     * Sets the "manuManager" element
     */
    public void setManuManager(com.seedwill.xul.widget.XMenuManager manuManager)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XMenuManager target = null;
            target = (com.seedwill.xul.widget.XMenuManager)get_store().find_element_user(MANUMANAGER$8, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XMenuManager)get_store().add_element_user(MANUMANAGER$8);
            }
            target.set(manuManager);
        }
    }
    
    /**
     * Appends and returns a new empty "manuManager" element
     */
    public com.seedwill.xul.widget.XMenuManager addNewManuManager()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XMenuManager target = null;
            target = (com.seedwill.xul.widget.XMenuManager)get_store().add_element_user(MANUMANAGER$8);
            return target;
        }
    }
    
    /**
     * Unsets the "manuManager" element
     */
    public void unsetManuManager()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(MANUMANAGER$8, 0);
        }
    }
    
    /**
     * Gets the "user" element
     */
    public com.seedwill.xul.widget.XUser getUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XUser target = null;
            target = (com.seedwill.xul.widget.XUser)get_store().find_element_user(USER$10, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "user" element
     */
    public boolean isSetUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(USER$10) != 0;
        }
    }
    
    /**
     * Sets the "user" element
     */
    public void setUser(com.seedwill.xul.widget.XUser user)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XUser target = null;
            target = (com.seedwill.xul.widget.XUser)get_store().find_element_user(USER$10, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XUser)get_store().add_element_user(USER$10);
            }
            target.set(user);
        }
    }
    
    /**
     * Appends and returns a new empty "user" element
     */
    public com.seedwill.xul.widget.XUser addNewUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XUser target = null;
            target = (com.seedwill.xul.widget.XUser)get_store().add_element_user(USER$10);
            return target;
        }
    }
    
    /**
     * Unsets the "user" element
     */
    public void unsetUser()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(USER$10, 0);
        }
    }
    
    /**
     * Gets the "session" element
     */
    public com.seedwill.xul.widget.XSession getSession()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XSession target = null;
            target = (com.seedwill.xul.widget.XSession)get_store().find_element_user(SESSION$12, 0);
            if (target == null)
            {
                return null;
            }
            return target;
        }
    }
    
    /**
     * True if has "session" element
     */
    public boolean isSetSession()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(SESSION$12) != 0;
        }
    }
    
    /**
     * Sets the "session" element
     */
    public void setSession(com.seedwill.xul.widget.XSession session)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XSession target = null;
            target = (com.seedwill.xul.widget.XSession)get_store().find_element_user(SESSION$12, 0);
            if (target == null)
            {
                target = (com.seedwill.xul.widget.XSession)get_store().add_element_user(SESSION$12);
            }
            target.set(session);
        }
    }
    
    /**
     * Appends and returns a new empty "session" element
     */
    public com.seedwill.xul.widget.XSession addNewSession()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.widget.XSession target = null;
            target = (com.seedwill.xul.widget.XSession)get_store().add_element_user(SESSION$12);
            return target;
        }
    }
    
    /**
     * Unsets the "session" element
     */
    public void unsetSession()
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(SESSION$12, 0);
        }
    }
    
    /**
     * Gets array of all "dbSource" elements
     */
    public com.seedwill.xul.core.XDBSource[] getDbSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(DBSOURCE$14, targetList);
            com.seedwill.xul.core.XDBSource[] result = new com.seedwill.xul.core.XDBSource[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "dbSource" element
     */
    public com.seedwill.xul.core.XDBSource getDbSourceArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSource target = null;
            target = (com.seedwill.xul.core.XDBSource)get_store().find_element_user(DBSOURCE$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "dbSource" element
     */
    public int sizeOfDbSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DBSOURCE$14);
        }
    }
    
    /**
     * Sets array of all "dbSource" element
     */
    public void setDbSourceArray(com.seedwill.xul.core.XDBSource[] dbSourceArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(dbSourceArray, DBSOURCE$14);
        }
    }
    
    /**
     * Sets ith "dbSource" element
     */
    public void setDbSourceArray(int i, com.seedwill.xul.core.XDBSource dbSource)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSource target = null;
            target = (com.seedwill.xul.core.XDBSource)get_store().find_element_user(DBSOURCE$14, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(dbSource);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "dbSource" element
     */
    public com.seedwill.xul.core.XDBSource insertNewDbSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSource target = null;
            target = (com.seedwill.xul.core.XDBSource)get_store().insert_element_user(DBSOURCE$14, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "dbSource" element
     */
    public com.seedwill.xul.core.XDBSource addNewDbSource()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSource target = null;
            target = (com.seedwill.xul.core.XDBSource)get_store().add_element_user(DBSOURCE$14);
            return target;
        }
    }
    
    /**
     * Removes the ith "dbSource" element
     */
    public void removeDbSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DBSOURCE$14, i);
        }
    }
    
    /**
     * Gets array of all "dbSchemaSource" elements
     */
    public com.seedwill.xul.core.XDBSchemaSource[] getDbSchemaSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(DBSCHEMASOURCE$16, targetList);
            com.seedwill.xul.core.XDBSchemaSource[] result = new com.seedwill.xul.core.XDBSchemaSource[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "dbSchemaSource" element
     */
    public com.seedwill.xul.core.XDBSchemaSource getDbSchemaSourceArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSchemaSource target = null;
            target = (com.seedwill.xul.core.XDBSchemaSource)get_store().find_element_user(DBSCHEMASOURCE$16, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "dbSchemaSource" element
     */
    public int sizeOfDbSchemaSourceArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(DBSCHEMASOURCE$16);
        }
    }
    
    /**
     * Sets array of all "dbSchemaSource" element
     */
    public void setDbSchemaSourceArray(com.seedwill.xul.core.XDBSchemaSource[] dbSchemaSourceArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(dbSchemaSourceArray, DBSCHEMASOURCE$16);
        }
    }
    
    /**
     * Sets ith "dbSchemaSource" element
     */
    public void setDbSchemaSourceArray(int i, com.seedwill.xul.core.XDBSchemaSource dbSchemaSource)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSchemaSource target = null;
            target = (com.seedwill.xul.core.XDBSchemaSource)get_store().find_element_user(DBSCHEMASOURCE$16, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(dbSchemaSource);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "dbSchemaSource" element
     */
    public com.seedwill.xul.core.XDBSchemaSource insertNewDbSchemaSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSchemaSource target = null;
            target = (com.seedwill.xul.core.XDBSchemaSource)get_store().insert_element_user(DBSCHEMASOURCE$16, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "dbSchemaSource" element
     */
    public com.seedwill.xul.core.XDBSchemaSource addNewDbSchemaSource()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.seedwill.xul.core.XDBSchemaSource target = null;
            target = (com.seedwill.xul.core.XDBSchemaSource)get_store().add_element_user(DBSCHEMASOURCE$16);
            return target;
        }
    }
    
    /**
     * Removes the ith "dbSchemaSource" element
     */
    public void removeDbSchemaSource(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(DBSCHEMASOURCE$16, i);
        }
    }
}
